
//高阶组件反向继承，可以控制展示，操作state,劫持渲染
import React from 'react';

// const iiHoc = role=>WrappedComponent => class extends WrappedComponent {
const iiHoc = WrappedComponent => class extends WrappedComponent {
    constructor(props){
        super(props);
        this.state.num="123"

    }
    render() {
        console.log(this.state, 'state');
        if(this.state.loading)//loading =true
        {
            return <div>抱歉，你无权限访问</div>
        }else{
            return  super.render();
        }
    }
}

export default iiHoc;
